package com.spring.srv;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class InitDestroy implements InitializingBean, DisposableBean {

	private String message;
	
	public String getMessage() {
	  return message;
	}

	public void setMessage(String message) {
	  this.message = message;
	}
	
	@Override
	public String toString() {
		return "InitDestroy [message=" + message + "]";
	}

	public void destroy() throws Exception {
		System.out.println("something in destroy!");
	}

	public void afterPropertiesSet() throws Exception {
		System.out.println("Init method after properties are set : " + message);
	}

}
